//
//  ORCollectionViewCell.m
//  NewsHots
//
//  Created by rimi on 2016/12/2.
//  Copyright © 2016年 zhongshuilian. All rights reserved.
//

#import "ORCollectionViewCell.h"

@interface ORCollectionViewCell ()

@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UIImageView *imageView;


@end

@implementation ORCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self.contentView addSubview:self.imageView];
        [self.contentView addSubview:self.nameLabel];
    }
    return self;
}

-(UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [[UIImageView alloc]initWithFrame:AAdaptionRect(0, 0, self.frame.size.width, self.frame.size.height)];
        _imageView.layer.cornerRadius = 10;
        _imageView.layer.masksToBounds = YES;
        
        CALayer *layer = [_imageView layer];
        layer.borderColor = [UIColor darkGrayColor].CGColor;
        layer.borderWidth = 3.f;
        
    }
    return _imageView;
}

-(UILabel *)nameLabel{
    
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.imageView.frame)+5, self.frame.size.width, 18)];
        _nameLabel.textColor = [UIColor darkTextColor];
        _nameLabel.font = [UIFont systemFontOfSize:12];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _nameLabel;
}

@end
